package com.proxyforgame.tetris;

import javax.swing.JFrame;
import javax.swing.SwingUtilities;
import com.proxyforgame.tetris.model.Config;
import com.proxyforgame.tetris.model.TetrisGame;
import com.proxyforgame.tetris.view.TetrisView;

public class SimpleTetris extends JFrame {

	public SimpleTetris() {
		super("SimpleTetris");

		setDefaultCloseOperation(EXIT_ON_CLOSE);
		Config config = new Config();
		config.setWidth(10);
		config.setHeight(20);
		config.setStartRandomLines(4);
		config.setStartDelay(2000);
		config.setDelayDecrementByLevel(100);
		config.setLinesForLevelUp(5);
		final TetrisGame game = new TetrisGame();
		TetrisView tv = new TetrisView(game);
		add(tv);
		game.initialize(config);

		setSize(300, 500);
		setLocationRelativeTo(null);
		setVisible(true);
	}

	public static void main(String[] args) {
		SwingUtilities.invokeLater(new Runnable() {
			@Override
			public void run() {
				new SimpleTetris();
			}
		});
	}

}
